/*
 * ListOrdened.h
 *
 *  Created on: 21/01/2012
 *      Author: marcio
 */

#ifndef LISTORDENED_H_
#define LISTORDENED_H_


typedef struct{
	void* head;
	void* last;
}ListOrdened;

ListOrdened* listordened_newList();

int listordened_addFirst(ListOrdened* l, void* elem);

int listordened_addLast(ListOrdened* l, void* elem);

void* listordened_getElemFirst(ListOrdened* l);

void* listordened_getElemLast(ListOrdened* l);

int listordened_removeElemFirst(ListOrdened* l);

void listordened_remove(ListOrdened* l, void* elem);

int listordened_search(ListOrdened* l, void* elem, int (*lookfor)(void*, void*));

int listordened_removeElemLast(ListOrdened* l);

int listordened_iterateModify(ListOrdened* l, void* (*function)(void*));

ListOrdened* listordened_iterate(ListOrdened* l, void* (*function)(void*));

int listordened_order(ListOrdened* l, int (*function)(void*, void*));

int listordened_isEmpty(ListOrdened* l);
#endif /* LISTORDENED_H_ */
